iconhelper: Use new snapshot transforms
authorBenjamin Otte <otte@redhat.com>
Thu, 21 Feb 2019 04:34:12 +0000 (05:34 +0100)
committerBenjamin Otte <otte@redhat.com>
Thu, 21 Feb 2019 18:47:28 +0000 (19:47 +0100)
gtk/gtkiconhelper.c

index 6b8f63e9ff67fd439d85dc734d5faf6f4cc1aa19..5698b2bdbc6fd9e75de1146f7f9863b107098154 100644 (file)
@@ -227,13 +227,14 @@ gtk_icon_helper_paintable_snapshot (GdkPaintable *paintable,
         h = MIN (h, height);
         x = (width - w) / 2;
         y = (height - h) / 2;
-        gtk_snapshot_offset (snapshot, x, y);
+        gtk_snapshot_save (snapshot);
+        gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (x, y));
         gtk_css_style_snapshot_icon_paintable (style,
                                                snapshot,
                                                self->paintable,
                                                w, h,
                                                self->texture_is_symbolic);
-        gtk_snapshot_offset (snapshot, -x, -y);
+        gtk_snapshot_restore (snapshot);
       }
       break;
 
@@ -268,13 +269,14 @@ gtk_icon_helper_paintable_snapshot (GdkPaintable *paintable,
         x = floor (width - ceil (w)) / 2;
         y = floor (height - ceil (h)) / 2;
 
-        gtk_snapshot_offset (snapshot, x, y);
+        gtk_snapshot_save (snapshot);
+        gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (x, y));
         gtk_css_style_snapshot_icon_paintable (style,
                                                snapshot,
                                                self->paintable,
                                                w, h,
                                                self->texture_is_symbolic);
-        gtk_snapshot_offset (snapshot, -x, -y);
+        gtk_snapshot_restore (snapshot);
       }
       break;
     }